package br.edu.utfpr.backupTools.view.action.backup;

import br.edu.utfpr.backupTools.model.pojo.Backup;
import br.edu.utfpr.backupTools.util.enums.TipoConexao;
import br.edu.utfpr.backupTools.view.action.AbstractCommand;
import br.edu.utfpr.backupTools.view.action.strategy.impl.GerarBackupLocal;
import br.edu.utfpr.backupTools.view.action.strategy.impl.GerarBackupRemoto;
import br.edu.utfpr.comum.RetornoValidacao;

public class GerarBackupIndividual extends AbstractCommand<Backup> {

	@Override
	public RetornoValidacao execute(Backup bean) {
		gerarBackup =  bean.getTipoConexao().equals(TipoConexao.LOCAL) ? new GerarBackupLocal() : new GerarBackupRemoto();
		return gerarBackup.gerarBackup(bean);
	}

}
